
#include "cocos2d.h"
#include "Director/DifficultyFactors/SpawnDifficultyLoader.h"

#include "config.h"
#include "src/TestMacros.h"
#include "src/CheckMacros.h"
#include "src/TestRunner.h"
#include "src/TimeConstraint.h"
#include "src/ReportAssert.h"

using namespace cocos2d;
using namespace UnitTest;

SUITE(SpawnDifficultyLoader)
{

	TEST(GetCatDifficulty)
	{
		CHECK_EQUAL(SpawnDifficultyLoader::getCatDifficulty(0), 0);
		CHECK_EQUAL(SpawnDifficultyLoader::getCatDifficulty(-95), 0);

		// Enums 1,2,3,4,6,7 different types of cats
		for(int i=1; i<=4; i++)
		{
			bool hasValue = SpawnDifficultyLoader::getCatDifficulty(i) != 0;
			CHECK_EQUAL(hasValue, true);
		}
		bool hasValue = SpawnDifficultyLoader::getCatDifficulty(6) != 0;
		CHECK_EQUAL(hasValue, true);
		hasValue = SpawnDifficultyLoader::getCatDifficulty(7) != 0;
		CHECK_EQUAL(hasValue, true);

		CHECK_EQUAL(SpawnDifficultyLoader::getCatDifficulty(8), 0);
		CHECK_EQUAL(SpawnDifficultyLoader::getCatDifficulty(16), 0);
	}

	TEST(GetCatInterval)
	{
		CHECK_EQUAL(SpawnDifficultyLoader::getCatInterval(0), 0);
		CHECK_EQUAL(SpawnDifficultyLoader::getCatInterval(-95), 0);

		// 6 different types of cats
		for(int i=1; i<=4; i++)
		{
			bool hasValue = SpawnDifficultyLoader::getCatInterval(i) != 0;
			CHECK_EQUAL(hasValue, true);
		}
		bool hasValue = SpawnDifficultyLoader::getCatDifficulty(6) != 0;
		CHECK_EQUAL(hasValue, true);
		hasValue = SpawnDifficultyLoader::getCatDifficulty(7) != 0;
		CHECK_EQUAL(hasValue, true);

		CHECK_EQUAL(SpawnDifficultyLoader::getCatInterval(8), 0);
		CHECK_EQUAL(SpawnDifficultyLoader::getCatInterval(16), 0);
	}


}
